<template>
	<view class="box">
		<view class="imgs-box">
		  <image :src="url"></image>
		</view>
	</view>
</template>

<script>
	import imgs from './imgs.js'
	export default {
		props: {
			imgType: {
				type: String
			}
		},
		data() {
			return {
				imgs,
				url: ''
			}
		},
		mounted() {
			switch(this.imgType) {
				// 订单: dingdan
			  case 'dingdan':
					this.url = imgs.dingdan
					break;
				// 地址: dizhi
			  case 'dizhi':
					this.url = imgs.dizhi
					break;
				// 购物车: gouwuche
				case 'gouwuche':
					this.url = imgs.gouwuche
					break;
				// 内容: neirong
				case 'neirong':
					this.url = imgs.neirong
					break;
				// 收藏: shoucang
				case 'shoucang':
					this.url = imgs.shoucang
					break;
				// 数据: shuju
				case 'shuju':
					this.url = imgs.shuju
					break;
				// 网络: wangluo
				case 'wangluo':
					this.url = imgs.wangluo
					break;
				// 优惠券: youhuiquan
				case 'youhuiquan':
					this.url = imgs.youhuiquan
					break;
			 default:
					throw new Error('imgType error')
			} 
		}
	}
</script>

<style lang="scss" scoped>
	.box{
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 2;
		display: flex;
		justify-content: center;
		align-items: center;
		.imgs-box{
			width:374rpx;
			height:295rpx;
		}
		image{
			width: 100%;
			height: 100%;
		}
	}
</style>
